package guy.flavell.core.genome;

import guy.flavell.core.naming.OrphanNames;

public class Person {

	private Forenames forename;
	private Surnames surname;
	private Person mother;
	private Person father;
	private Genome genome;
	
	public Person() {
		mother = null;
		father = null;
		genome = new Genome();
		chooseName();
	}
	
	public Person(Person motherIn, Person fatherIn) {
		this.mother = motherIn;
		this.father = fatherIn;
		genome = new Genome(mother.getGamete(), father.getGamete());
		chooseName();
	}
	
	private Gamete getGamete() {
		return new Gamete(genome);
	}
	
	private void chooseName() {
		if(null == mother && null == father) {
			boolean isMale = genome.isMale();
			if(isMale ) {
				forename = FirstName.getRandomMaleName();
			} else {
				forename = FirstName.getRandomFemaleName();
			}
			surname = OrphanNames.getRandomName();
		}
	}
}
